package basic;

public class offer64_1 {
 int i,sum =0;

    public int sumNums(int n) {
       while (i<=n){
           sum+=i;
           i++;
       }
        return sum;
    }

    public static void main(String[] args) {
        offer64_1 offer64_1 = new offer64_1();
        System.out.println(offer64_1.sumNums(3));

    }
}
